package com.example.arithmeticleetcode.leetcode.s2021.july;

/**
 * @author fangzhen@focusmedia.cn
 * @creation time 2021/9/24
 */
public class Demo02 {

    private static final ThreadLocal<String> threadLocalName =
            ThreadLocal.withInitial(() -> Thread.currentThread().getName());

    public static void main(String[] args) {
        int count = Runtime.getRuntime().availableProcessors();
        for (int i = 0; i < count; i++) {
            new Thread(() -> {
                System.out.println("threadName:" + threadLocalName.get());
            }, "yes-thread-" + i).start();
        }
    }
}
